/////////////////////////////////////////////////////////////////////////////
/*/	
 *	Creator:		Michael Duff
 *	Title:			
 *	Last Edited:	06/17/2013
 *	Summary:		
/*/
/////////////////////////////////////////////////////////////////////////////
#ifndef CEVENTMANAGER_H
#define CEVENTMANAGER_H
#include "Event.h"
#include "Listener.h"
#include <list>
#include <map>
using namespace std;
class CEventManager{
private:
	list<Event> m_CurrentEvents;
	multimap<string, CListener*> m_Clients;

public:
	CEventManager(void);
	~CEventManager(void);
	CEventManager(CEventManager& ref) {};
	CEventManager& operator=(CEventManager& ref) {};
	static CEventManager* GetInstance();
	void RegisterListener(string EventID, CListener* Client);
	void UnregisterListener(string EventID, CListener* Client);
	void UnregisterAllListeners(CListener* Client);
	bool AlreadyRegistered(string EventID, CListener* Client);
	bool CheckEventTriggered(string EventID);
	void SendEventNow(string EventID, void* Data = NULL, void* Listener= NULL, void* Sender= NULL);
	void SendEvent(string EventID, void* Data = NULL, void* Listener= NULL, void* Sender= NULL);
	void HandleEvent(Event* pEvent);
	void ProcessEvents();
	void ClearEvents();
	void Shutdown();

};
#endif